package cc.fine.svc.config.mq;

import com.rabbitmq.client.AMQP;
import javafx.scene.control.cell.TextFieldListCell;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @AUTHOR: wyihe
 * @DATE: 2023/10/28
 *
 * 控制异步任务的mq配置
 */
@Configuration
public class RabbitmqSyncConfig {

    public static final String EXCHANGE = "fine";

    public static final String QUEUE = "fine.sync";

    public static final String BINDING = "fine.sync";

    @Bean
    public DirectExchange directExchange() {
        return new DirectExchange(EXCHANGE);
    }

    @Bean
    public Queue queue() {
        return new Queue(QUEUE);
    }

    @Bean
    public Binding binding() {
        return BindingBuilder
                .bind(queue())
                .to(directExchange())
                .with(BINDING);
    }
}
